<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class BlogModel extends Model
{
    use HasFactory;
    protected $table = 'blog';
    protected $primaryKey = 'blog_id';
    protected $keyType = 'int';
    public $incrementing =true;
    public $timestamps = true;
    protected $fillable=[
        'title',
        'content',
        'user_id',
        'type'
    ];

    public function comment(){
        return $this->hasMany('App\Models\comment','comment_id','blog_id');
    }
}
